package com.ruoyi.web.controller.pc;

import com.ruoyi.business.service.IWmsStatisticsService;
import com.ruoyi.business.vo.DeliveryVo;
import com.ruoyi.business.vo.StockVo;
import com.ruoyi.business.vo.StockWarningVo;
import com.ruoyi.business.vo.WarehouseVo;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 统计报表Controller
 */
@RestController
@RequestMapping("/business/statistics")
public class WmsStatisticsController extends BaseController {

    @Autowired
    private IWmsStatisticsService wmsStatisticsService;

    /**
     * 库存查询
     */
    @GetMapping("stock")
    public TableDataInfo stock(StockVo query) {
        startPage();
        List<StockVo> list = wmsStatisticsService.stock(query);
        return getDataTable(list);
    }

    /**
     * 库存查询
     */
    @GetMapping("warehouse")
    public TableDataInfo warehouse(WarehouseVo query) {
        startPage();
        List<WarehouseVo> list = wmsStatisticsService.warehouse(query);
        return getDataTable(list);
    }

    /**
     * 库存查询
     */
    @GetMapping("delivery")
    public TableDataInfo delivery(DeliveryVo query) {
        startPage();
        List<DeliveryVo> list = wmsStatisticsService.delivery(query);
        return getDataTable(list);
    }

    /**
     * 库存预警
     */
    @GetMapping("stockWarning")
    public TableDataInfo stockWarning(StockWarningVo query) {
        startPage();
        List<StockWarningVo> list = wmsStatisticsService.stockWarning(query);
        return getDataTable(list);
    }
}
